﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 凌依.工具库
{
    public static class 数学_补充
    {
        /// <summary>
        /// 输入最小值与最大值 得到范围后 输入value可获得在范围的百分比
        /// </summary>
        /// <param name="Min"></param>
        /// <param name="Max"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public static float 取值区间百分比(float Min, float Max, float value) => (value - Min) / (Max - Min);
        public static int 取值区间百分比(int Min, int Max, int value) => (value - Min) / (Max - Min);
        public static double 取值区间百分比(double Min, double Max, double value) => (value - Min) / (Max - Min);
        public static long 取值区间百分比(long Min, long Max, long value) => (value - Min) / (Max - Min);
    }
}
